package com.yanqu.road.entity.manor;

import com.alibaba.fastjson.JSON;
import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.player.UserBaseInfo;

import java.util.Objects;

/**
 * @author ：zfr
 * @date ：2021/6/18 11:23
 */
public class ManorHelpRecord extends DataObject {
    private long userId;
    private long operateUserId;
    private String recordUid;
    private UserBaseInfo operateBaseInfo = new UserBaseInfo();
    private long recordTime;

    public long getUserId() {
        return userId;
    }

    public void setUserId(long userId) {
        if(this.userId != userId) {
            this.userId = userId;
            setUpdateOption();
        }
    }

    public String getRecordUid() {
        return recordUid;
    }

    public void setRecordUid(String recordUid) {
        if(!Objects.equals(this.recordUid, recordUid)) {
            this.recordUid = recordUid;
            setUpdateOption();
        }
    }

    public long getOperateUserId() {
        return operateUserId;
    }

    public void setOperateUserId(long operateUserId) {
        if(this.operateUserId != operateUserId) {
            this.operateUserId = operateUserId;
            setUpdateOption();
        }
    }

    public long getRecordTime() {
        return recordTime;
    }

    public void setRecordTime(long recordTime) {
        if(this.recordTime != recordTime) {
            this.recordTime = recordTime;
            setUpdateOption();
        }
    }

    public UserBaseInfo getOperateBaseInfo() {
        return operateBaseInfo;
    }

    public String getOperateBaseInfoJsonStr(){
        if(null == operateBaseInfo){
            return "{}";
        }else {
            return JSON.toJSONString(operateBaseInfo);
        }
    }

    public void setOperateBaseInfo(UserBaseInfo operateBaseInfo) {
        this.operateBaseInfo = operateBaseInfo;
        setUpdateOption();
    }
}
